1
Operators
2
Tasks 1–3
3
Tasks 4–6
4
Extension
5
Exit Quiz
Lesson 3 Β· Year 8 Databases

Queries in Access

Today you'll build six queries using the Access Query Design grid β€” filtering, sorting, and searching the DataDrop Songs database like a real data analyst.

🎯
Learning Objectives
βœ“
Create a select query using Query Design grid
Drag fields into the grid and set criteria in the correct row
βœ“
Use operators to filter data
=, >, <, >=, <=, BETWEEN, AND, OR, wildcards (*)
βœ“
Sort results and show/hide fields
Use the Sort row and Show checkbox in the QBE grid
βœ“
Create a parameterised query
Use [prompt text] in the criteria to ask the user for input
πŸ“–
Query Operators β€” Reference
OperatorMeaningExample
=Exactly equal to= "Pop"
>Greater than> 1000000
<Less than< 2020
>=Greater than or equal to>= 3
<=Less than or equal to<= 4
BETWEEN x AND yIn a range (inclusive)BETWEEN 2019 AND 2021
ANDBoth conditions must be true> 3 AND < 4
OREither condition is true"Pop" OR "Rock"
NOTExcludes matching recordsNOT "Pop"
LIKE "x*"Starts with x (wildcard)Like "The*"
How to create a query: Go to Create β†’ Query Design. Double-click the Songs table to add it. Drag fields into the grid. Type your criteria in the Criteria row. Click Run (!) to see results. Save with Ctrl+S.
Step 2 of 5 Β· Tasks 1–3

Query Tasks 1–3

Open DataDrop_L3.accdb and create a new query for each task. Name and save each one.

Q1
All Pop Songs
Brief: The marketing team wants a list of every Pop song. Show ALL fields. Save as "Q1 Pop Songs".
β†’
Which field do you put the criteria on? What do you type in the Criteria row?
How many records did your query return?
Q2
High Streams β€” Sorted
Brief: Show only Title, Artist, and Streams for songs with more than 5 million streams. Sort results from most to least popular. Save as "Q2 High Streams".
β†’
What criteria did you use? What sort order did you choose and for which field?
How do you HIDE a field from results without removing it? (Hint: there's a checkbox.)
Q3
Medium Length Songs
Brief: DataDrop's algorithm recommends songs between 3 and 4 minutes long. Show all fields. Use BETWEEN in your criteria. Save as "Q3 Medium Length".
β†’
Write the exact criteria you used in the Criteria row:
How many songs are between 3 and 4 minutes?
Step 3 of 5 Β· Tasks 4–6

Query Tasks 4–6

These tasks use multiple criteria and wildcards. Think carefully about whether to put criteria on the same row (AND) or different rows (OR).

AND vs OR tip: To use AND β€” put both criteria on the same Criteria row. To use OR β€” put the second criteria on the Or: row below.
Q4
Pop or Electronic
Brief: Show only Title, Artist and Genre for songs that are either Pop OR Electronic. Save as "Q4 Pop or Electronic".
β†’
How many records did you get? Did you use the same Criteria row or the Or: row?
Q5
Titles Starting With "The"
Brief: Find all songs where the title begins with "The". Use a wildcard (*). Show all fields. Save as "Q5 The Songs".
β†’
Write the exact criteria you typed (including "Like"):
List the song titles returned:
Q6
Older Songs
Brief: DataDrop wants a "throwback" playlist. Show Title and Artist for songs released in 2019 or earlier. Sort by ReleaseYear (oldest first). Save as "Q6 Throwback Songs".
β†’
What criteria and sort did you use? How many songs qualify?
Step 4 of 5

Extension: Parameterised Query

A parameterised query asks the user for input when it runs β€” instead of hard-coding the criteria.

πŸš€ Extension
Build a Genre Search Tool
Create a new query called "Genre Search". In the Genre field's Criteria row, type: [Enter a genre to search:]. When you run the query, Access will pop up a box asking the user to type a genre. The query then filters by whatever they type β€” dynamic search!
⚑
Parameterised Query Tasks
1
Build the parameterised query
Create Query Design β†’ Add Songs table β†’ Add all fields β†’ In Genre's Criteria row type: [Enter a genre to search:]. Save as "Genre Search".
2
Test it three times
Run the query and enter "Pop", then "Indie", then "K-Pop". Record how many results you get each time.
3
Reflect
Why is a parameterised query more useful than six separate genre queries?
Step 5 of 5

Exit Quiz

βœ…
Lesson 3 Check
πŸ“€
Export Your Answers

Download all your answers from every section as a text file β€” then upload to Google Classroom.

🎡
Lesson Complete!

Excellent work β€” you can now query a database like a professional. Next lesson: you'll ditch the GUI and write real SQL β€” the language behind every major database on the planet.

Go to Lesson 4 β€” SQL β†’